#ifndef __BSP_SOFT_IIC_H_
#define __BSP_SOFT_IIC_H_
#include "stdint.h"

typedef struct{
	char *name;
	uint32_t slave_addr;
	uint32_t reg_addr;
	void (*delay)(void);
	void (*delay_ms)(void);
	void (*SDA_OUT)(void);
	void (*SDA_IN)(void);
	uint8_t (*SDA_READ)(void);
	void (*SDA_L)(void);
	void (*SDA_H)(void);
	void (*SCK_L)(void);
	void (*SCK_H)(void);
}soft_iic_dev_t;


void soft_iic_start(soft_iic_dev_t *dev);
void soft_iic_stop(soft_iic_dev_t *dev);
uint8_t soft_iic_wait_ack(soft_iic_dev_t *dev);
void soft_iic_ack(soft_iic_dev_t *dev);
void soft_iic_nack(soft_iic_dev_t *dev);
uint8_t soft_iic_read_byte(soft_iic_dev_t *dev, uint8_t ack);
void soft_iic_send_byte(soft_iic_dev_t *dev, uint8_t ch);

#endif
